package com.suxin.socket.yinfei;

import com.suxin.socket.yinfei.handler.AbstractMessageHandler;
import com.suxin.socket.yinfei.handler.DefaultMessageHandler;
import com.suxin.socket.yinfei.session.SessionConnectionHolder;
import com.suxin.socket.yinfei.session.SimpleSessionConnectionHolder;
import org.springframework.stereotype.Component;

import javax.websocket.server.ServerEndpoint;

/**
 * @author Tang
 * @classname DevicesDataConnection
 * @description [  ]
 * @date 2021/8/17 22:26
 */
@Component
@ServerEndpoint(value = "/device/data")
public class DevicesDataConnection extends AbstractParameterDataConnection {

    private static SessionConnectionHolder sessionConnectionHolder = new SimpleSessionConnectionHolder();

    @Override
    protected SessionConnectionHolder getSessionConnectionHolder() {
        return sessionConnectionHolder;
    }

    /**
     * 数据处理流程
     * @return
     */
    @Override
    public AbstractMessageHandler getAbstractMessageHandler() {
        return new DefaultMessageHandler();
    }
}